package com.ehotting.edsta.diagnosisPredict.feign;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.PageDto;
import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.*;
import com.ehotting.edsta.diagnosisPredict.feign.factory.DiagnosisPredictFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 零散的算法模块接口归集
 */
@FeignClient(name = "modelManager", url = "${request.url.prefix}",fallbackFactory = DiagnosisPredictFallbackFactory.class)
public interface DiagnosisPredictFeignService {

    /**
     * 获取模型详情
     * @param predictListDto
     * @return
     */
    @PostMapping(value = "/predicttask/predict-task/search")
    Response<PageDto<PublishPredictTaskDto>> searchPredictTask(@RequestBody PredictListDto predictListDto);


    /**
     * 获取算法接口（进入加载）
     * @param projectType
     * @return
     */
    @GetMapping(value = "/classify/get-algorithm-by-type")
    Response<List<AlgorithmInfoDto>> getAlgorithmByType(@RequestParam("projectType") String projectType);


    /**
     * 发布模型
     * @param req
     * @return
     */
    @PostMapping(value = "/publishtask/publish-task-data/publish")
    Response<Boolean> publish(@RequestBody PublishTaskDataReqDto req);

    /**
     * 原始数据文件属性字段列表列表
     * @return
     */
    @GetMapping(value = "/feDatafield/list")
    Response<List<FeDatafield>> list(@RequestParam("createTime") String createTime,
                                     @RequestParam("datafileId") Long datafileId,
                                     @RequestParam("id") Long id,
                                     @RequestParam("name") String name,
                                     @RequestParam("name2") String name2,
                                     @RequestParam("type") String type);

    /**
     * 条件过滤字段列表
     * @return
     */
    @PostMapping(value = "/feFilterRule/saveOrUpdateBatch")
    Response<String> saveOrUpdateBatchFilterRule(@RequestBody FeFilterRule[] t);

    /**
     * 缺失值处理字段列表
     * @return
     */
    @PostMapping(value = "/feMissingRule/saveOrUpdateBatch")
    Response<String> saveOrUpdateBatchMissingRule(@RequestBody FeMissingRule[] t);

    /**
     * 重复值处理字段列表
     * @return
     */
    @PostMapping(value = "/feDuplicateRule/saveOrUpdateBatch")
    Response<String> saveOrUpdateBatchDuplicateRule(@RequestBody FeDatafield[] t);

    /**
     * 属性生成字段列表
     * @return
     */
    @PostMapping(value = "/feAttributecreateRule/saveOrUpdateBatch")
    Response<String> saveOrUpdateBatchAttrCreateRule(@RequestBody FeAttributecreateRule[] t);

    /**
     * 数据标准化字段列表
     * @return
     */
    @PostMapping(value = "/feStandardRule/saveOrUpdateBatch")
    Response<String> saveOrUpdateBatchStandardRule(@RequestBody FeStandardRule[] t);
}